From d85bfd5e0094ee1f15e4253c98ee1faf8ee6c0a4 Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Tue, 28 Jan 2020 22:29:29 +0000 Subject: [PATCH] Use same Python version for subprocess test Avoids a fail due to mismatched extension .so version when multiple Python 3 versions are available Author: Rebecca N. Palmer Forwarded: no Gbp-Pq: Name subprocess_use_same_pyver.patch --- statsmodels/tests/test_package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statsmodels/tests/test_package.py b/statsmodels/tests/test_package.py index 74dd519..694300e 100644 --- a/statsmodels/tests/test_package.py +++ b/statsmodels/tests/test_package.py @@ -15,7 +15,8 @@ def test_lazy_imports(): "assert not mods, mods") # TODO: is there a cleaner way to do this import in an isolated environment - pyexe = 'python3' if PY3 else 'python' + import sys + pyexe = sys.executable or 'python3' p = subprocess.Popen(pyexe + ' -c "' + cmd + '"', shell=True, close_fds=True) p.wait() -- 2.30.2